﻿<?xml version="1.0" encoding="utf-8" ?>
<DataLayout>

  <!-- ********************************************** -->
  <!--              OBJECT DEFINITIONS                -->
  <!-- ********************************************** -->
  <Objects>

    <Object name="Artifact" parent="NamedObject">
      <Reference name="Method" object="Method" />
      <Field name="Position" type="integer" />
      <Enum name="Direction" enum="Direction" storeAs="InvokeType" />
      <Enum name="FieldType" enum="Type" />
      <Field name="Name" type="string" />
      <Enum name="Teste" type="MeuTest">
        <Value>Algo</Value>
        <Value>Diferente</Value>
        <Value>Carro</Value>
      </Enum>
    </Object>

    <Object name="Keyword" parent="NamedObject">
      <Field name="Name" type="string" />
    </Object>

    <Object name="Method" parent="NamedObject">
      <Reference name="Service" object="Service" />
      <Field name="Name" type="string"/>
      <Enum name="Returns" enum="Type" storeAs="ReturnType" />
      <Enum name="CallStyle" enum="WSDL.SOAP.OperationStyle" />
      <Enum name="InputEncoding" enum="WSDL.SOAP.BodyUse" />
      <Enum name="OutputEncoding" enum="WSDL.SOAP.BodyUse" />
    </Object>

    <Object name="ServiceEndpoint" parent="BasicObject">
      <Reference name="Service" object="Service" />
      <Field name="Location" type="string" />
      <Enum name="Type" enum="EndpointType" />
    </Object>

    <Object name="Service" parent="NamedObject">
      <Reference name="User" object="User" storeAs="Owner" />
      <Reference name="Parent" object="Namespace" storeAs="Tree" />
      <Field name="Name" type="string" />
      <Field name="ClassName" type="string" />
      <Field name="Description" type="text" />
      <Field name="Location" type="uri" />
    </Object>

    <Object name="Namespace" parent="NamedObject">
      <Reference name="Parent" object="Namespace" />
      <Reference name="User" object="User" storeAs="Owner" />
      <Field name="Name" type="string" />
      <Field name="Description" type="text" />
    </Object>

    <Object name="Tag" parent="NamedObject">
      <Field name="Name" type="string" />
      <Field name="Description" type="text" />
    </Object>

    <Object name="User" parent="NamedObject">
      <Field name="Name" type="string" />
    </Object>

  </Objects>

  <!-- ********************************************** -->
  <!--        RELATIONSHIP BETWEEN OBJECTS            -->
  <!-- ********************************************** -->
  <Relations>

    <Relation object="TestRel" one="Artifact" two="Artifact" twoWay="true" oneName="TagList" twoName="ArtList">
      <Field name="Test" type="integer" />
    </Relation>
    <Relation one="Artifact" two="Tag" twoWay="true" />

    <Relation one="Service" two="Keyword" twoWay="true" />
    <Relation one="Service" two="Tag" twoWay="true" />

    <!-- ServiceRanks -->
    <Relation object="Rank" one="Service" two="User">
      <Field name="Rank" type="integer" />
    </Relation>

    <Relation one="Namespace" two="Keyword" twoWay="true" />
    <Relation one="Namespace" two="Tag" twoWay="true" />

    <Relation object="Comment" one="Tag" two="User">
      <Field name="Text" type="text" />
    </Relation>

  </Relations>
</DataLayout>